/* File Info 
 * Author:      cknight 
 * CreateTime:  2021/1/20 下午1:18:52 
 * LastEditor:  cknight 
 * ModifyTime:  2021/1/22 上午9:55:02 
 * Description: 扫码登录
 */
const { ScanStatus } = require("wechaty");
/**
 * @param {type} qrcode I am argument qrcode. 
 * @param {type} status I am argument status. 
 */
async function onScan(qrcode, status) {
    if (status === ScanStatus.Waiting && qrcode) {
        const qrcodeImageUrl = [
            "https://api.qrserver.com/v1/create-qr-code/?data=",
            encodeURIComponent(qrcode),
        ].join("");
        console.log(
            `onScan: ${ScanStatus[status]}(${status}) - ${qrcodeImageUrl}`
        );
    } else {
        console.log(`onScan: ${ScanStatus[status]}(${status})`);
    }
}
module.exports = onScan